package com.hhq.system.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hhq.system.common.model.Option;
import com.hhq.system.model.entity.SysTenant;
import com.hhq.system.model.form.TenantForm;
import com.hhq.system.model.vo.TenantPageVO;
import com.hhq.system.model.vo.TenantVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * 部门对象转换器
 *
 * @author haoxr
 * @since 2022/7/29
 */
@Mapper(componentModel = "spring")
public interface TenantConverter {


    @Mappings({@Mapping(target = "value", source = "id"), @Mapping(target = "label", source = "name")})
    Option entity2Option(SysTenant tenant);


    List<Option> entities2Options(List<SysTenant> sysTenants);

    Page<TenantPageVO> convertToPageVo(Page<SysTenant> page);

    TenantForm convertToForm(SysTenant entity);

    TenantVO convertToVo(SysTenant entity);

    List<TenantVO> convertToVo(List<SysTenant> entitys);

    SysTenant convertToEntity(TenantForm tenantForm);

}
